import request from '@/utils/request'

// 查询是否可以执行,true可通行； false不可通行
export function queryIsOk() {
  return request({
    url: '/after-exam-score/formalAnswer/queryIsOk',
    method: 'get',
  })
};

// 1.核验答案开始
// 学生填空题答案插入答案穷举表
export function insertThQuesScores(query) {
  return request({
    url: '/after-exam-score/formalAnswer/tianKongInsertThQuesScoreMapping',
    method: 'post',
    params: query
  })
};

// 学生填空题答案插入答案穷举表
export function getTianKongList(query) {
  return request({
    url: '/after-exam-score/thQuesScoreMapping/tianKongList',
    method: 'get',
    params: query
  })
};

// 修改答案分数,传入id,score即可
export function updateScore(query) {
  return request({
    url: '/after-exam-score/thQuesScoreMapping',
    method: 'put',
    data: query
  })
};

// 批量删除
export function deleteBatch(ids) {
  return request({
    url: `/after-exam-score/thQuesScoreMapping/${ids}`,
    method: 'delete'
  })
};
// 1.核验答案结束


// 2.导入第三方分值开始
// 导入-上传表格
export function importScoreExcel(subjectRelationId) {
  return request({
    url: `/after-exam-score/importScoreExcel/${subjectRelationId}`,
    method: 'post'
  })
};
// 核验导入
export function subjectiveQuestionsInsert(data) {
  return request({
    url: `/after-exam-score/importScoreExcel/${data}subjectiveQuestionsInsert`,
    method: 'post'
  })
};
// 2.导入第三方分值结束


// 3.科目算分，生成分数表开始
// 单科列表-获得各科目算分状态列表
export function getCalculateScoreList() {
  return request({
    url: '/after-exam-score/calculateScore/queryCalculateScoreStatus',
    method: 'get'
  })
};


// 单科列表-单科抽查分数需要的subejct_id
export function querySpotCheckSubject() {
  return request({
    url: '/after-exam-score/spotCheckAnswer/querySpotCheckSubject',
    method: 'get'
  })
};

// 单科列表-多线程算分,根据答案穷举表更新score
export function formalUpdateScore(subjectIds) {
  return request({
    url: `/after-exam-score/formalAnswer/updateScore/${subjectIds}`,
    method: 'put'
  })
};

// 单科列表-算分，传入学科relation_subject_id，字符串数组
export function insertFromDpSubjectScore(type,subjectIds) {
  return request({
    url: `/after-exam-score/calculateScore/insertFromDpSubjectScore/${type}/${subjectIds}`,
    method: 'post'
  })
};

// 单科列表-算分,返回更新进度,已经乘100但没加'%'号
export function updateScoreProcess() {
  return request({
    url: '/after-exam-score/formalAnswer/updateScoreProcess',
    method: 'get'
  })
};

// 单科列表-查询计算分值错误,有错误则返回错误列表,没错误则不返回data
export function queryTsinghuaFormalAnswerErr() {
  return request({
    url: '/after-exam-score/formalAnswer/queryTsinghuaFormalAnswerErr',
    method: 'get'
  })
};

// 单科列表-获取插入两张表进度
export function queryInsertProcess() {
  return request({
    url: '/after-exam-score/calculateScore/queryinsertFromDpSubjectScoreProcess',
    method: 'get'
  })
};

// 单科列表-查询生成表错误,有错误则返回错误列表,没错误则不返回data
export function queryInsertQuesErr() {
  return request({
    url: '/after-exam-score/calculateScore/queryInsertQuesErr',
    method: 'get'
  })
};

// 总分配置-获取总分移除科目列表
export function queryRemoveSubject(subjectIds) {
  return request({
    url: '/after-exam-score/calculateScore/queryRemoveSubject',
    method: 'get'
  })
};

// 总分配置-查询总分表状态
export function queryTotalScoreState() {
  return request({
    url: '/after-exam-score/dpTotalScore/queryTotalScoreState',
    method: 'post'
  })
};

// 总分配置-从dp_subject_score里把数据插入到dp_total_score,每次执行会把dp_total_score数据清空,
export function dpTotalScoreInsert() {
  return request({
    url: '/after-exam-score/dpTotalScore/insertFromDpSubjectScore',
    method: 'post'
  })
};

// 总分配置-总分移除科目
export function saveRemoveSubject(subjectIds) {
  return request({
    url: `/after-exam-score/calculateScore/saveRemoveSubject/${subjectIds}`,
    method: 'post'
  })
};
// 3.科目算分，生成分数表结束


// 4.抽验答案开始
// 总分抽验-总分抽验答案列表
export function querySpotCheckAnswerTotal(query) {
  return request({
    url: '/after-exam-score/spotCheckAnswer/querySpotCheckAnswerTotal',
    method: 'get',
    params: query
  })
};

// 总分抽验-总分抽验答案列表,传准考证
export function queryAnswerSource(query) {
  return request({
    url: '/after-exam-score/spotCheckAnswer/queryAnswerSource',
    method: 'get',
    params: query
  })
};

// 单科抽验-单科抽验答案列表，必须传入relationSubjectId
export function querySpotCheckAnswerSubject(query) {
  return request({
    url: '/after-exam-score/spotCheckAnswer/querySpotCheckAnswerSubject',
    method: 'get',
    params: query
  })
};
// 修改抽验状态（总分需要zkzNum,spotCheckStatus,e_status,单科需要zkzNum,spotCheckStatus,relationSubjectId）
export function updateSpotCheckStatus(query) {
  return request({
    url: '/after-exam-score/spotCheckAnswer/updateSpotCheckStatus',
    method: 'put',
    data: query
  })
};

// 4.抽验答案结束


// 5.获取考生成绩开始
// 生成excel表，传excelType类型，1校考，2标考
export function exportScoreExcel(excelType) {
  return request({
    url: `/after-exam-score/exportScoreExcel/${excelType}`,
    method: 'post'
  })
};

// 获取下载成绩表的进度
export function queryExportScoreExcelProcess() {
  return request({
    url: '/after-exam-score/exportScoreExcel/queryexportScoreExcelProcess',
    method: 'get'
  })
};

// 判断是否存在压缩包（是否已经下载过成绩表至服务器）
export function getExcelZipExsit() {
  return request({
    url: '/after-exam-score/exportScoreExcel/getExcelZipExsit',
    method: 'get'
  })
};

// 标考-上传压缩包（上传初始表）
export function uploadHaiXiaoFolder() {
  return request({
    url: '/after-exam-score/dataReprocessing/uploadHaiXiaoFolder',
    method: 'post'
  })
};

// 标考-获取上传进度
export function queryDataByHaiXiaoProcess() {
  return request({
    url: '/after-exam-score/dataReprocessing/queryDataReprocessingByHaiXiaoProcess',
    method: 'get'
  })
};

// 标考-查询上传错误
export function queryDataByHaiXiaoErr() {
  return request({
    url: '/after-exam-score/dataReprocessing/queryDataReprocessingByHaiXiaoErr',
    method: 'get'
  })
};

// 标考-导出成绩表
export function dealToQingHuaData() {
  return request({
    url: '/after-exam-score/dataReprocessing/dealToQingHuaData',
    method: 'get'
  })
};

// 标考-判断是否存在压缩包
export function getExcelZipExsitBK() {
  return request({
    url: '/after-exam-score/dataReprocessing/getExcelZipExsit',
    method: 'get'
  })
};

// 标考-存在压缩包，返回压缩包
export function getExcelZip() {
  return request({
    url: '/after-exam-score/dataReprocessing/getExcelZip',
    method: 'get'
  })
};

// 5.获取考生成绩结束

// 选择考试类型下一步
export function OneNext() {
  return request({
    url: '/after-exam-score/RoadScore/OneNext',
    method: 'put'
  })
};

// 核验答案下一步
export function TwoNext() {
  return request({
    url: '/after-exam-score/RoadScore/OneNext',
    method: 'put'
  })
};

// 导入第三方分值下一步
export function ThreeNext() {
  return request({
    url: '/after-exam-score/RoadScore/TwoNext',
    method: 'put'
  })
};

// 科目算分，生成分数表下一步
export function FourNext() {
  return request({
    url: '/after-exam-score/RoadScore/ThreeNext',
    method: 'put'
  })
};

// 抽验答案下一步
export function fiveNext() {
  return request({
    url: '/after-exam-score/RoadScore/FourNext',
    method: 'put'
  })
};
